home *** CD-ROM | disk | FTP | other *** search
-
- class TTEApplication : public TApplication {
- public:
- virtual pascal void ITEApplication(OSType itsMainFileType);
- virtual pascal struct TDocument *DoMakeDocument(CmdNumber itsCmdNumber);
- virtual pascal struct TCommand *DoMenuCommand(CmdNumber aCmdNumber);
- virtual pascal void PoseModalDialog();
- #ifdef qDebug
- virtual pascal void IdentifySoftware();
- #endif
- };
-
- class TTEDocument;
-
- class TPaletteView : public TView {
-
- // friend class TTEDocument;
-
- public:
- int fIconSelected;
- virtual pascal void IPaletteView(TTEDocument *itsTEDocument);
- virtual pascal struct TCommand *DoMouseCommand(Point *theMouse,
- EventInfo *info, Point *hysteresis);
- pascal void DoHighlightSelection(HLState fromHL, HLState toHL);
- pascal void Draw(Rect *area);
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
-
- class TBox : public TObject {
- public:
- Rect fLocation;
- Boolean fSelected;
- RgnHandle fTagRgn;
- Rect fTL,fTR,fBL,fBR,
- fT,fB,fL,fR;
- virtual pascal void IBox(Rect *itsLocation);
- virtual pascal void DrawShape();
- virtual pascal void NeedDiskSpace(long *data);
- virtual pascal void Read(short aRefNum);
- virtual pascal void Write(short aRefNum);
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
- class TShape : public TBox {
- public:
- short fPenSize;
- Pattern fPenPat;
- Pattern fFillPat;
- virtual pascal void NeedDiskSpace(long *data);
- virtual pascal void IBox(Rect *itsLocation);
-
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
- class TRect : public TShape {
- public:
- pascal void DrawShape();
- pascal void NeedDiskSpace(long *data);
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
- class TOval : public TShape {
- public:
- pascal void DrawShape();
- pascal void NeedDiskSpace(long *data);
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
- class TRoundRect : public TShape {
- public:
- short fOvalWidth;
- short fOvalHeight;
-
- pascal void IBox(Rect *itsLocation);
- pascal void DrawShape();
- pascal void NeedDiskSpace(long *data);
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
-
- class TTextView : public TTEView {
-
- public:
- TTEDocument *fTEDocument;
- TPaletteView *fPaletteView;
- Boolean fUpdated;
- pascal void ITextView(TTEDocument *itsTEDocument);
- pascal Boolean DoIdle(IdlePhase phase);
- pascal struct TCommand *DoKeyCommand(short ch,
- short aKeyCode, EventInfo *info);
- pascal struct TCommand *DoMenuCommand(CmdNumber aCmdNumber);
- pascal void DoSetupMenus ();
- pascal struct TCommand *DoMouseCommand(Point *theMouse,
- EventInfo *info, Point *hysteresis);
- pascal Boolean DoSetCursor(Point localPoint, RgnHandle cursorRgn);
- pascal void Draw(Rect *area);
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
- class TColorCmd : public TCommand {
-
- // friend class TTEDocument;
-
- public:
- TTEDocument *fTEDocument;
- TTextView *fTextView;
- int fOldColorCmd, fNewColorCmd; // menu command numbers
- pascal void IColorCmd(int aCmdNumber, TTEDocument *itsDocument,
- TTextView *itsView);
- pascal void DoIt();
- pascal void RedoIt();
- pascal void UndoIt();
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
-
- class TSketcher : public TCommand {
-
- public:
- TTEDocument *fTEDocument;
- TTextView *fTextView;
- TBox *fBox; // the object being sketched
- Rect fBoxLocation; // size of the Box being sketched
- pascal void ISketcher(TTEDocument *itsDocument, TTextView *itsView);
- pascal struct TCommand *TrackMouse(TrackPhase aTrackPhase,
- VPoint *anchorPoint, VPoint *previousPoint,
- VPoint *nextPoint, Boolean mouseDidMove);
- pascal void DoIt();
- pascal void RedoIt();
- pascal void UndoIt();
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
-
- class TDragger : public TCommand {
-
- public:
- TTEDocument *fTEDocument;
- TTextView *fTextView;
- TBox *fBox; // the object being dragged
- Rect oldLocation; // initial location of object
- Rect newLocation; // new location of object
- Point fDelta; // offset moved
- PicHandle fFeedbackPicture; // support for Track feedback
- Rect fPictureBounds; // idem
- pascal void IDragger(TBox *itsBox, TTEDocument *itsDocument, TTextView *itsView);
- pascal struct TCommand *TrackMouse(TrackPhase aTrackPhase,
- VPoint *anchorPoint, VPoint *previousPoint,
- VPoint *nextPoint, Boolean mouseDidMove);
- pascal void TrackFeedback(VPoint *anchorPoint, VPoint *nextPoint,
- Boolean turnItOn, Boolean mouseDidMove);
- pascal void DoIt();
- pascal void RedoIt();
- pascal void UndoIt();
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
- class TSizer : public TCommand {
-
- public:
- TTEDocument *fTEDocument;
- TTextView *fTextView;
- TBox *fBox; // the object being dragged
- Rect oldLocation; // initial location of object
- Rect newLocation; // new location of object
- Point fStart; // mouse pressed here
- Point fDelta; // offset moved
- Boolean pT,pB,pL,pR;
- // flags to indicate which coordinates to change
- pascal void ISizer(TBox *itsBox, TTEDocument *itsDocument, TTextView *itsView);
- pascal struct TCommand *TrackMouse(TrackPhase aTrackPhase,
- VPoint *anchorPoint, VPoint *previousPoint,
- VPoint *nextPoint, Boolean mouseDidMove);
- pascal void TrackFeedback(VPoint *anchorPoint, VPoint *nextPoint,
- Boolean turnItOn, Boolean mouseDidMove);
- pascal void DoIt();
- pascal void RedoIt();
- pascal void UndoIt();
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
-
- class TTEDocument : public TDocument {
- public:
- TPaletteView *fPaletteView;
- TTextView *fTextView;
- Handle fTextHdl; // text typed by user
- int fTextColorCmd; // menu command number
- TList *fShapeList; // list of Shapes to be drawn
- pascal void ITEDocument();
- pascal void AddShape(TBox *aBox);
- pascal void DeleteShape();
- pascal void DoMakeWindows();
- pascal void DoMakeViews(Boolean forPrinting);
- pascal void DoNeedDiskSpace(long *dataForkBytes, long *rsrcForkBytes);
- pascal void DoRead(short aRefNum, Boolean rsrcExists, Boolean forPrinting);
- pascal void DoWrite(short aRefNum, Boolean makingCopy);
- pascal void ForEachShapeDo(pascal void (*DoToItem)
- (TObject *item, void *DoToItem_Staticlink),void *DoToItem_Staticlink);
- pascal void Free();
- pascal void SetTextColorCmd(int theColorCmd);
- pascal int TextColorCmd();
- #ifdef qDebug
- virtual pascal void Fields(pascal void (*DoToField) (StringPtr fieldName,
- Ptr fieldAddr, short fieldType, void *link), void *link);
- #endif
- };
-
-
- // --- global definitions ---
-
- typedef pascal void (*DoToObject) (TObject *aObject, void *DoToObject_staticlink);
-
- struct CalcDiskSpaceStruct {
- long myDataForkBytes;
- };
-
- struct DoToRectStruct {
- int myRefNum;
- };
-
- // support for dragging, JL 9/90
- struct FindBoxStruct {
- Point theMouse;
- TBox *myBox;
- };
-
- // support for selections, JL 1/91
- struct SelectStruct {
- TTextView *myTextView;
- };
-
- // support for moves, JL 1/91
- struct MoveStruct {
- Point delta;
- };
-
- //
- // --- end of declarations ---
- //
-